<%-- 
    Document   : mem_details
    Created on : Oct 7, 2009, 3:36:00 AM
    Author     : bharath
--%>
<jsp:useBean id ="ms" scope="session" class="Login.MySqlConnector"/>
<jsp:setProperty name="ms" property="*" />
<%@ page import="java.io.* ,java.util.*, java.sql.*, Login.* , javax.servlet.http.* , Registration.* " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>SCF - Who's Who</title>
        <link rel="stylesheet" href="./css/yellow.css" />
        <link rel="stylesheet" href="./css/small.css" />
		 <link href="style.css" rel="stylesheet" type="text/css" />
        <!-- Loading Calendar JavaScript files -->
        <script type="text/javascript" src="./js/zapatec.js"></script>
        <script type="text/javascript" src="./js/calendar.js"></script>
        <!-- Loading language definition file -->
        <script type="text/javascript" src="./js/calendar-en.js"></script>
        <meta http-equiv="content-type" content="text/xml; charset=utf-8" />

        
    </head>
    <body  bgcolor="#0D62A2">
	<div align="left"><span class="bluetext"><a href="javascript:history.go(-1)">Back</a>
    <%
        HttpSession hs = request.getSession(true);
        String memid = (String) hs.getAttribute("memid");
        System.out.println("member id is " + memid);
	    Connection con = ms.Connect();
       
	    String q = "select distinct(profname) from proffession ;";
        PreparedStatement stmt1 = con.prepareStatement(q);
        System.out.println("query is : " + q);
        ResultSet rs1 = stmt1.executeQuery();
        String q1 = "select distinct(state) from states ;";
        System.out.println("query for states is : " + q1);
        PreparedStatement stmt2 = con.prepareStatement(q1);
		String name = request.getParameter("name");
        System.out.println("name in serach result is "+name);
		String prof = request.getParameter("prof");
		String state = request.getParameter("state");
		
		String squery = " SELECT memberid , name, prof, mobile, email, state FROM registration where (memberid like '%"+name+"' or name like '%"+name+"') and prof like '%"+prof+"' and state like '%"+state+"' ";
		PreparedStatement stmtsearch = con.prepareStatement(squery);
        System.out.println("query is : " + stmtsearch);
        ResultSet rssearch = stmtsearch.executeQuery();
		
    %>
	  
        <a href = "Logout.jsp">Logout</a></span> </div>
	<h1 align="center" class="style1"><span class="style24">Welcome :</span> <%=memid%></h1>
    <form action="LoginServlet" method="post" name="form1" id="form1">
      <table width="660" height="87" border="1" align="left" bordercolor="#CCCCCC" bgcolor="#63BAD8" class="greenlink_no_left_padding" >
        <tr>
          <td height="32" colspan="5" bgcolor="#D8F2C9" class="greentext"><h3 align="center" class="bluetext">Member Result </h3></td>
        </tr>
        <tr>
          <td width="129" height="23" class="greentext">MEMEBER ID </td>
          <td width="108" class="greentext">NAME</td>
          <td width="129" class="greentext">PROFESSION</td>
          <td width="135" class="greentext">MOBILE</td>
          <td width="125" class="greentext">EMAIL ID </td>
        </tr>
        <%
        while(rssearch.next()==true)
		{ %>
        <tr>
          <td height="22" class="greentext"><span class="style21"><%=rssearch.getString(1)%></span></td>
          <td class="greentext"><span class="style21"><%=rssearch.getString(2)%></span></td>
          <td class="greentext"><span class="style21"><%=rssearch.getString(3)%></span></td>
          <td class="greentext"><span class="style21"><%=rssearch.getString(4)%></span></td>
          <td class="greentext"><span class="style21"><%=rssearch.getString(5)%></span></td>
       <% } %> </tr>
      </table>
    </form>
	
    </body>
</html>

